#include <stdio.h>

void main(){
	
	/* members declarations */

	char symbol;
	int base;
	int type;
	int i;

	/* get data from user */
	printf("Enter type:");
	scanf("%d", &type);
	flushall(); //flush buffer
	
	printf("Enter symbol:");
	scanf("%c", &symbol);

	printf("Enter base:");
	scanf("%d", &base);


	//evaluate 'type' and proceed
	if (type ==1){
		for(i=0; i < base; i++){
			int j = 0;
			while (j != i+1){
				printf("%c", symbol);
				j++;
			}
			printf("\n");
		}
	} 
	if(type ==2){
		int j = 0;
		for(i=0; i < base; i++){
						
			while(j < base-(i+1)){
				printf(" ");
				j++;
			}
			for(j=0; j < (i+1); j++){
				printf("%c", symbol);
			}
			printf("\n");
			j = 0;	
		}

	}else {
		printf("Invalid type");
	}
}


